package com.example.schoolexam2.service;

import com.example.schoolexam2.entity.QuestionCheckd;
import com.example.schoolexam2.entity.QuestionFill;
import com.example.schoolexam2.entity.QuestionJudge;
import com.example.schoolexam2.entity.QuestionRadio;
import com.example.schoolexam2.vo.PageVo;
import com.example.schoolexam2.vo.QuestionsToListVo;
import com.github.pagehelper.PageInfo;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileInputStream;
import java.util.List;

public interface QuestionService {
    /**
     * 读取题库文件，将其保存到数据库中
     */
    boolean redAndSave(MultipartFile file,int i,String teacherId) throws Exception;

    /**
     * 获取所有的试题
     */
    QuestionsToListVo getAllQuestion(String[] department,String isPublic);

    /**
     * 删除试题
     */
    Boolean delQuestion(String questionId,int type);
    /**
     * 更新试题
     */
    Boolean updateQuestion(Object obj);
    /**
     * 通过id获取试题信息
     */
    Object getQuestionById(String questionId,String type);

    /**
     * 分页获取数据，分别获取试题
     * @param department 待查部门数组
     * @param isPublic   是否公开
     * @param currentpage  当前页
     * @param size          页面长度
     * @return
     */
    PageVo getPageRadio(String[] department, String isPublic, int currentpage, int size,String qname);
    PageVo getPageCheckd(String[] department, String isPublic, int currentpage, int size,String qname);
    PageVo getPageFill(String[] department, String isPublic, int currentpage, int size,String qname);
    PageVo getPageJudge(String[] department, String isPublic, int currentpage, int size,String qname);

    int getQuestionCount(String type);
}
